require.config({
	paths: {
		"jquery" : "jquery-1.11.3",
		"common" : "common",
		"cookie" : "cookie",
		"ajax" : "ajax"
	}
});


require(["jquery","common","cookie","ajax"],function($,common,cookie,ajax){
	$(".header").load("header.html #top",function(){common.fn();});
	$(".footer").load("footer.html",function(){common.fn();});
	$(".side").load("side.html",function(){common.fn();});

	product = eval("(" + getCookie("product_1") + ")");
	if(product){
		$(".cart_box").hide();
		$(".cart_form").html("<div class='shopping_con'><div class='c_meg'><dl><dt><a href='details.html'><img src='" + product.src + "' width='78px' height='78px'></a></dt><dd><p class='m_tit'><a href='details.html'>"+product.name+"</a></p></dd></dl></div><div class='c_price'><p class='c_price_num'>¥<i>"+product.price+"</i></p></div><div class='c_quantity'><div class='c_amount clearfix'><a href='javascript:void(0)'>-</a><input name='amt' type='text' value='"+product.num+"'><a href='javascript:void(0)'>+</a></div></div><div class='c_sum'><p>¥<i>"+product.num * product.price+"</i></p></div><div class='c_action'><i class='i_del'>删除</i></div><div class='c_check'><input checked='checked' type='checkbox'></div></div>");
	}else {
		$(".cart_box").show();
		$(".shoppingCart").hide();
	}
	/*删除商品*/
	$(".i_del").click(function(){
		removeCookie("product_1");
		location.reload()
	});
	
	/*清空购物车*/
	$(".qt").click(function(){
		removeCookie("product_1");
		location.reload()
	});
	
	
});